package cn.tpshion.config.common;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties("config")
public class ConfigProperties {

    /**
     * 是否开启配置中心
     */
    private Boolean enable = true;

    /**
     * 配置域
     */
    private String name;

    /**
     * 配置中心地址
     */
    private String host = "localhost:8848";

    /**
     * 配置中心认证方式：code-授权码模式 password-密码模式
     */
    private String type = "code";

    /**
     * 用户名：默认admin
     */
    private String username = "admin";

    /**
     * 密码：默认admin
     */
    private String password = "password";

    /**
     * 授权码
     */
    private String secretkey;

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSecretkey() {
        return secretkey;
    }

    public void setSecretkey(String secretkey) {
        this.secretkey = secretkey;
    }

    @Override
    public String toString() {
        return "ConfigProperties{" +
                "enable=" + enable +
                ", name='" + name + '\'' +
                ", host='" + host + '\'' +
                ", type='" + type + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", secretkey='" + secretkey + '\'' +
                '}';
    }
}
